﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using OauthProvider;

namespace Chat_WebServer
{
    public class ConsumerStore : IConsumerStore
    {
        //
        // GET: /ConsumerStore/

        public bool IsConsumer(IConsumer consumer)
        {
            using (var db = new AccountEntities())
            {
                return (db.Consumers.FirstOrDefault(c => c.ConsumerKey == consumer.ConsumerKey) != null
                    && string.IsNullOrEmpty(consumer.Realm));
            }
        }

        public void SetConsumerSecret(IConsumer consumer, string consumerSecret)
        {
            throw new NotImplementedException();
        }

        public string GetConsumerSecret(IOAuthContext consumer)
        {
            throw new NotImplementedException();
        }

        public void SetConsumerCertificate(IConsumer consumer, System.Security.Cryptography.X509Certificates.X509Certificate2 certificate)
        {
            throw new NotImplementedException();
        }

        public System.Security.Cryptography.AsymmetricAlgorithm GetConsumerPublicKey(IConsumer consumer)
        {
            throw new NotImplementedException();
        }
    }
}
